package com.sscaipiao.android.common;

import com.sscaipiao.android.R;
import com.sscaipiao.android.activity.DaLeTou.DaLeTouActivity;
import com.sscaipiao.android.activity.DaLeTou.DaLeTouHistoryActivity;
import com.sscaipiao.android.activity.DaLeTou.DaLeTouPayActivity;
import com.sscaipiao.android.activity.DongFangLiuJiaYi.DongFangLiuJiaYiActivity;
import com.sscaipiao.android.activity.DongFangLiuJiaYi.DongFangLiuJiaYiHistoryActivity;
import com.sscaipiao.android.activity.DongFangLiuJiaYi.DongFangLiuJiaYiPayActivity;
import com.sscaipiao.android.activity.PaiLieSan.*;
import com.sscaipiao.android.activity.PaiLieWu.PaiLieWuActivity;
import com.sscaipiao.android.activity.PaiLieWu.PaiLieWuHistoryActivity;
import com.sscaipiao.android.activity.PaiLieWu.PaiLieWuPayActivity;
import com.sscaipiao.android.activity.QiLeCai.QiLeCaiActivity;
import com.sscaipiao.android.activity.QiLeCai.QiLeCaiHistoryActivity;
import com.sscaipiao.android.activity.QiLeCai.QiLeCaiPayActivity;
import com.sscaipiao.android.activity.QiXingCai.QiXingCaiActivity;
import com.sscaipiao.android.activity.QiXingCai.QiXingCaiHistoryActivity;
import com.sscaipiao.android.activity.QiXingCai.QiXingCaiPayActivity;
import com.sscaipiao.android.activity.ShiWuXuanWu.ShiWuXuanWuActivity;
import com.sscaipiao.android.activity.ShiWuXuanWu.ShiWuXuanWuHistoryActivity;
import com.sscaipiao.android.activity.ShiWuXuanWu.ShiWuXuanWuPayActivity;
import com.sscaipiao.android.activity.ShiYiXuanWu.ShiYiXuanWuActivity;
import com.sscaipiao.android.activity.ShiYiXuanWu.ShiYiXuanWuHistoryActivity;
import com.sscaipiao.android.activity.ShiYiXuanWu.ShiYiXuanWuPayActivity;
import com.sscaipiao.android.activity.ShuangSeQiu.DoubleColorBallActivity;
import com.sscaipiao.android.activity.ShuangSeQiu.DoubleColorBallHisActivity;
import com.sscaipiao.android.activity.ShuangSeQiu.DoubleColorBallPayActivity;
import com.sscaipiao.android.activity.ThreeD.SanDZhiXuanActivity;
import com.sscaipiao.android.activity.ThreeD.SanDZhiXuanHistoryActivity;
import com.sscaipiao.android.activity.ThreeD.SanDZhiXuanPayActivity;
import com.sscaipiao.android.model.LotteryEntry;

import java.util.HashMap;

public class Constants {

	//public static final String SERVER_URL = "http://58.246.139.30:10080/mobile/";
	public static final String SERVER_URL = "http://58.246.139.30:20080/mobile/";
	public final static String app_package = "com.sscaipiao.android";
	public final static String network_error = "网络连接错误，请打开网络连接后重新进入";
	public final static String apk_folder = "apk/";
	public final static String apk_file_name = "SScaipiao.apk";
	public final static String UPDATE_SAVENAME = "SScaipiao.apk";
	public static final String STRING_SPLITE = ",";
	public static final String STRING_SPLITE_COMPLEX = "<,>";

	public static final String LOGIN_SUCCESS_CODE = "01";

	public static final String STATUS = "status";
	public static final String MESSAGE = "strMessage";
	public static final String APKINFO = "apkInfo";
	public static final String TYPE = "type";

	public static final String TOKEN = "token";
	public static final String RAND = "rand";
	public static final String BANK = "bank";
	public static final String NAME = "name";
	public static final String BANK_NO = "bankno";
	public static final String ID_CARD = "idCard";
	public static final String CITY = "city";
	public static final String PROVINCE = "province";
	public static final String EMAIL = "email";
	public static final String BANK_FULL_NAME = "bankFullName";
	public static final String BALANCE = "balance";

	public static final String BANK_LIST="bankList";
	public static final String PROV_LIST="provList";
	public static final String CITY_LIST="cityList";
	public static final String SUB_BANK_LIST="subBankList";
	public static final String LOTTERY_LIST= "lotteryList";
	public static final String PERIOD_LIST= "periodList";
	public static final String USER = "user";
	public static final String HISTORY = "history";
	public static final String RECORD_LIST = "recordList";

	public static final String BET_STATUS_BINGO = "2";
	public static final int RANDOM_TYPE_IN_ALL =  0;
	public static final int RANDOM_TYPE_IN_GROUP =  1;

	public static final int MESSAGE_WORK_DOWN = 0x400 + 1;
	public static final int MESSAGE_UPDATE_HISTORY = 0x400 + 2;
	public static final int MESSAGE_UPDATE_DEADLINE = 0x400 + 3;
	public static final int MESSAGE_SHOW_TOAST = 0x400 + 4;

	public static final String CODE_ShuangSeQiu = "ssq";
	public static final String CODE_DongFangLiuJiaYi = "601";
	public static final String CODE_ShiShiCai = "ssc";
	public static final String CODE_RangQiuShengPingFu = "bd1";
	public static final String CODE_ZuQiuDanChang = "bd6";
	public static final String CODE_ShiYiXuanWu = "D11";
	public static final String CODE_AnHuiKuaiSan = "zch010";
	public static final String CODE_ChaoJiDaLeTou = "dlt";
	public static final String CODE_QiLeCai = "307";
	public static final String CODE_ShengFuCai = "sfc";
	public static final String CODE_BiFen = "bd4";
	public static final String CODE_PaiLieSan = "p3";
	public static final String CODE_ShiWuXuanWu = "155";
	public static final String CODE_SanDi = "3d";
	public static final String CODE_SiDi = "4d";
	public static final String CODE_LiuChangBanQuanChang = "bqc";
	public static final String CODE_BanQuanChang = "bd5";
	public static final String CODE_QiXingCai = "p7";
	public static final String CODE_ZongJinQiuShu = "bd2";
	public static final String CODE_ShiShiLe = "ssl";
	public static final String CODE_SiChangJinQiu = "4jq";
	public static final String CODE_ShangXiaDanShuang = "bd3";
	public static final String CODE_PaiLieWu = "p5";
//	public static final String CODE_ = "";


	public static HashMap<String,String> LOTTERY_TYPE_MAP = new HashMap<String,String>();
	public static final int LottNum =  24;
	public static LotteryEntry LOTT_ARRAY[] = {
			               //type   code        name
			new LotteryEntry("1",   CODE_ShuangSeQiu,           "双色球",       R.drawable.ic_suangseqiu,
					DoubleColorBallActivity.class, DoubleColorBallHisActivity.class, DoubleColorBallPayActivity.class),
			new LotteryEntry("7",   CODE_DongFangLiuJiaYi,      "东方6+1",     R.drawable.ic_liujiayi,
					DongFangLiuJiaYiActivity.class, DongFangLiuJiaYiHistoryActivity.class, DongFangLiuJiaYiPayActivity.class),
			new LotteryEntry("112", CODE_RangQiuShengPingFu,    "让球胜平负",    R.drawable.ic_none),
			new LotteryEntry("117", CODE_ZuQiuDanChang,         "足球单场",     R.drawable.ic_none),
			new LotteryEntry("106", CODE_ShiYiXuanWu,           "11选5",     R.drawable.ic_shiyixuanwu,
				    ShiYiXuanWuActivity.class, ShiYiXuanWuHistoryActivity.class, ShiYiXuanWuPayActivity.class),
			new LotteryEntry("201", CODE_AnHuiKuaiSan,          "安徽快3",     R.drawable.ic_none),
			new LotteryEntry("107", CODE_ChaoJiDaLeTou,         "超级大乐透",    R.drawable.ic_daletou,
			        DaLeTouActivity.class, DaLeTouHistoryActivity.class, DaLeTouPayActivity.class),
			new LotteryEntry("5",   CODE_QiLeCai,               "七乐彩",      R.drawable.ic_qilecai,
					QiLeCaiActivity.class, QiLeCaiHistoryActivity.class, QiLeCaiPayActivity.class),
			new LotteryEntry("108", CODE_ShengFuCai,            "胜负彩",      R.drawable.ic_shengfucai),
			new LotteryEntry("115", CODE_BiFen,                 "比分",       R.drawable.ic_none),
			new LotteryEntry("101", CODE_PaiLieSan,             "排列3",      R.drawable.ic_pailiesan,
					PaiLieSanActivity.class, PaiLieSanHistoryActivity.class, PaiLieSanPayActivity.class),
			new LotteryEntry("6",   CODE_ShiWuXuanWu,           "15选5",     R.drawable.ic_none,
					ShiWuXuanWuActivity.class, ShiWuXuanWuHistoryActivity.class, ShiWuXuanWuPayActivity.class),

			new LotteryEntry("3",   CODE_SanDi,                 "3D",       R.drawable.ic_sandi,
					SanDZhiXuanActivity.class, SanDZhiXuanHistoryActivity.class, SanDZhiXuanPayActivity.class),
			new LotteryEntry("4",   CODE_SiDi,                  "4D",       R.drawable.ic_none),
			new LotteryEntry("109", CODE_LiuChangBanQuanChang,  "六场半全场",R.drawable.ic_liuchangbanquanchang),
			new LotteryEntry("116", CODE_BanQuanChang,          "半全场",  R.drawable.ic_none),
			new LotteryEntry("103", CODE_QiXingCai,             "7星彩",  R.drawable.ic_qixingcai,
			        QiXingCaiActivity.class, QiXingCaiHistoryActivity.class, QiXingCaiPayActivity.class),
	        new LotteryEntry("50",  CODE_ShiShiCai,             "时时彩",  R.drawable.ic_none),
			new LotteryEntry("113", CODE_ZongJinQiuShu,         "总进球数",R.drawable.ic_none),
			new LotteryEntry("2",   CODE_ShiShiLe,               "时时乐",  R.drawable.ic_none),
			new LotteryEntry("110", CODE_SiChangJinQiu,         "四场进球",R.drawable.ic_sichangjinqiu),
			new LotteryEntry("114", CODE_ShangXiaDanShuang,     "上下单双",R.drawable.ic_none),
			new LotteryEntry("102", CODE_PaiLieWu,              "排列5",  R.drawable.ic_pailiewu,
					PaiLieWuActivity.class, PaiLieWuHistoryActivity.class, PaiLieWuPayActivity.class),

	};
	public static String getLottName(String code) {
		for (LotteryEntry entry : Constants.LOTT_ARRAY) {
			if (entry.getCode().equals(code)) {
				return  entry.getName();
			}
		}
		return "";
	}
	public static String getLottCode(String name) {
		for (LotteryEntry entry : Constants.LOTT_ARRAY) {
			if (entry.getName().equals(name)) {
				return  entry.getCode();
			}
		}
		return "";
	}

	public static String getLottCodeByClass(Class name) {
		for (LotteryEntry entry : Constants.LOTT_ARRAY) {
			if (entry.getActivity() == name
					|| entry.getHisActivity() == name
					|| entry.getPayActivity() == name) {
				return  entry.getCode();
			}
		}
		return "";
	}

	static {
		LOTTERY_TYPE_MAP.put("1", "双色球");
		//LOTTERY_TYPE_MAP.put("2", "时时乐");
		LOTTERY_TYPE_MAP.put("3", "3D");
		//LOTTERY_TYPE_MAP.put("4", "4D");
		LOTTERY_TYPE_MAP.put("5", "七乐彩");
		//LOTTERY_TYPE_MAP.put("6", "15选5");
		LOTTERY_TYPE_MAP.put("7", "东方6+1");
		//LOTTERY_TYPE_MAP.put("50", "时时彩");
		//LOTTERY_TYPE_MAP.put("101", "排列3");
		//LOTTERY_TYPE_MAP.put("102", "排列5");
		//LOTTERY_TYPE_MAP.put("103", "7星彩");
		LOTTERY_TYPE_MAP.put("106", "11选5");
		LOTTERY_TYPE_MAP.put("107", "超级大乐透");
//		LOTTERY_TYPE_MAP.put("108", "胜负彩");
//		LOTTERY_TYPE_MAP.put("109", "六场半全场");
//		LOTTERY_TYPE_MAP.put("110", "四场进球");
//		LOTTERY_TYPE_MAP.put("111", "快乐123");
//		LOTTERY_TYPE_MAP.put("112", "让球胜平负");
//		LOTTERY_TYPE_MAP.put("113", "总进球数");
//		LOTTERY_TYPE_MAP.put("114", "上下单双");
//		LOTTERY_TYPE_MAP.put("115", "比分");
//		LOTTERY_TYPE_MAP.put("116", "半全场");
//		LOTTERY_TYPE_MAP.put("117", "足球单场");
//		LOTTERY_TYPE_MAP.put("155", "15选5");
	}
//	"1,ssq,双色球"
//			"7,601,东方6+1"
//			"202,zch006,时时彩"
//			"112,bd1,让球胜平负"
//			"117,bd6,足球单场"
//			"106,D11,11选5"
//			"201,zch010,安徽快3"
//			"107,dlt,超级大乐透"
//			"5,307,七乐彩"
//			"108,sfc,胜负彩"
//			"115,bd4,比分"
//			"101,p3,排列3"
//			"6,155,15选5"
//			"3,3d,3D"
//			"4,4d,4D"
//			"109,bqc,六场半全场"
//			"116,bd5,半全场"
//			"103,p7,7星彩"
//			"50,ssc,时时彩"
//			"113,bd2,总进球数"
//			"2,ssl,时时乐"
//			"110,4jq,四场进球"
//			"114,bd3,上下单双"
//			"102,p5,排列5"

}
